# Contributor: Sergei Lukin <sergej.lukin@gmail.com>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=lcms2
pkgver=2.11
pkgrel=0
pkgdesc="Color Management Engine"
url="http://www.littlecms.com"
arch="all"
license="MIT GPL-3.0-only"
depends_dev="mozjpeg-dev tiff-dev zlib-dev"
makedepends="$depends_dev"
subpackages="$pkgname-dev $pkgname-doc $pkgname-utils"
source="$pkgname-$pkgver.tar.gz::https://github.com/mm2/Little-CMS/archive/$pkgver.tar.gz"
builddir="$srcdir/Little-CMS-$pkgver"

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--localstatedir=/var \
		--disable-static \
		--with-jpeg \
		--with-tiff \
		--with-zlib \
		--with-threads
	make
}

check() {
	make check
}

package() {
	make DESTDIR="$pkgdir" install
}

utils() {
	pkgdesc="Utility applications for lcms2"
	mkdir -p "$subpkgdir"/usr/
	mv "$pkgdir"/usr/bin "$subpkgdir"/usr/
}

sha512sums="dce2bcda29b3e7200b748d4f2345c55ae5d20ba00e1966886bbeaf7fb5d134420963ee1b3fd4e72297f42b0e131146ac72d45579f0871f2dc47385ba5cad1491  lcms2-2.11.tar.gz"
